package com.ddpt.platform.common.export.dto.merchant.operation;

import cn.hutool.core.collection.CollectionUtil;
import com.ddpt.platform.common.export.dto.ExportRequestDto;
import com.ddpt.platform.common.util.AssertUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;

@Getter
@Setter
public class OperationLogDto extends ExportRequestDto {
    //merchant store
    private String logType;
    /**
     * 用户Id
     */
    private Long userId;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 模糊查询关联信息
     */
    private String contactItem;

    @Override
    public void verification() {
        super.verification();
        AssertUtil.isNull(this.logType, "日志类型不能为空");
        AssertUtil.isTrue(!CollectionUtil.contains(Arrays.asList("merchant", "store"),
                this.logType), "日志类型错误");
    }

    @Override
    public String getSpeType() {
        return this.logType;
    }

    @Override
    public void setSpeType(String type) {
        this.logType = type;
    }
}
